package com.canyou.logback;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * 钉钉消息实体
 *
 * @author fy
 * @date 20/07/22 11:02
 */
@Data
public class DingMessage {

    private String msgtype = "text";
    private Text text;
    private At at;

    public static DingMessage defaultMessage(String content) {
        DingMessage message = new DingMessage();
        message.setText(new Text(content));
        return message;
    }

    @Data
    @AllArgsConstructor
    private static class Text {
        private String content;
    }

    @Data
    private static class At {
        private List<String> atMobiles;
        private boolean isAtAll;
    }

}
